Skip to content

[codex] Coerce stringified spawn agent params#658

Merged
jahooma merged 1 commit into
mainfrom
jahooma/fix-string-tool-args
May 12, 2026
Merged

[codex] Coerce stringified spawn agent params#658
jahooma merged 1 commit into
mainfrom
jahooma/fix-string-tool-args

Conversation

@brandonkachen
Copy link
Copy Markdown
Collaborator

Summary

Adds narrow coercion for spawn-agent params values when models emit a valid JSON object as a string. This covers both batched spawn_agents entries and spawn_agent_inline, while leaving malformed strings, arrays, and primitives to fail normal schema validation.

Also updates Freebuff e2e tests to use execFileSync instead of shell-quoted execSync for simple binary flag checks.

Why

Some providers can produce nested agent params as a JSON string even when the top-level tool call input is otherwise valid. That caused validation failures before the agent-specific params schema could run.

Validation

  • bun test common/src/tools/params/__tests__/coerce-to-array.test.ts
  • bun test packages/agent-runtime/src/__tests__/tool-validation-error.test.ts
  • bun run typecheck in common/
  • bun run typecheck in packages/agent-runtime/
  • git diff --check

Note: Freebuff e2e tests were not run because cli/bin/freebuff is not present in this workspace.

@jahooma jahooma merged commit 115a0d2 into main May 12, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/fix-string-tool-args branch May 12, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants